import http from './http'
let base = {
    pws: process.env.NODE_ENV === 'PRO' ? 'http://122.225.12.166:11481' : '/api'
}

export default {

    // 查询所有设备信息
    queryAllDevice() {
        return http.request({
            url: `${base.pws}/pound/deviceInfo/pagination.act?page=1&limit=1000`,
            data: {
                deviceType: "B"
            },
            method: 'post'
        })
    },
    // 登录接口
    login(data) {
        return http.request({
            url: `${base.pws}/pound/logon`,
            data: data,
            method: 'post'
        })
    },
    //过磅单管理分页查询 /pound/passPoundBill/pagination.act?  
    paginationpassPoundBill(pagination, data) {
        return http.request({
            url: `${base.pws}/pound/passPoundBill/pagination.act?limit=${pagination.pageSize}&page=${pagination.current}`,
            data: data,
            method: 'post',
        })
    },
    //场内车辆分页查询/pound/passPoundRecord/pagination.act?
    paginationpassPoundRecord(pagination, data) {
        return http.request({
            url: `${base.pws}/pound/passPoundRecord/pagination.act?limit=${pagination.pageSize}&page=${pagination.current}`,
            data: data,
            method: 'post'
        })
    },
    // 查询过磅单管理信息 /pound/passPoundBill/findById.act?A
    findPoundById(id) {
        return http.request({
            url: `${base.pws}/pound/passPoundBill/findById.act?id=${id}`,
            id: id,
            method: 'post'
        })
    },
    // 查询车辆是否有上一次未完成过磅记录--passPoundRecord/getUpRecord.act?carNumber=车牌号
    getUpPoundRecord(params) {
        // return axios.post(`${base.sq}/passPoundRecord/getUpRecord.act?${params}`);
        return http.request({
            url: `${base.pws}/pound/passPoundRecord/getUpRecord.act`,
            data: params,
            method: 'post'
        })
    },
    // 提交磅房-保存过磅单数据 passPoundRecord/addPassPoundRecord.act  /pound/passPoundRecord/addPassPoundRecord.act
    addPassPoundRecord(data) {
        return http.request({
            url: `${base.pws}/pound/passPoundRecord/addPassPoundRecord.act`,
            data: data,
            method: 'post'
        })
    },
    //查询所有物料
    queryMaterialInfoAll(pagination, data) {
        return http.request({
            url: `${base.pws}/pound/materialInfo/pagination.act?limit=${pagination.pageSize}&page=${pagination.current}`,
            data: data,
            method: 'post'
        })
    },























    //详情
    // queryWeeklyOverhaulPlanById(id) {
    //     return http.request({
    //         url: `${base.pms}/weeklyOverhaulPlan/queryInfoById/${id}`,
    //         method: 'get',
    //         headers: {
    //             "Content-Type": "application/x-www-form-urlencoded"
    //         }
    //     })
    // },

    // //添加
    // addWeeklyOverhaulPlan(data) {
    //     return http.request({
    //         url: `${base.pms}/weeklyOverhaulPlan/addWeeklyOverhaulPlan`,
    //         data: data,
    //         method: 'post'
    //     })
    // },



}